<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich" xml:lang="en">
<head>
<title>导师手工阅卷</title>
<meta http-equiv="keywords" content="enter,your,keywords,here" />
<meta http-equiv="description"
	content="A short description of this page." />
<link
	href="#{facesContext.externalContext.requestContextPath}/css/public.css"
	rel="stylesheet" type="text/css" media="screen" />
<link
	href="#{facesContext.externalContext.requestContextPath}/css/main.css"
	rel="stylesheet" type="text/css" media="screen" />
<link
	href="#{facesContext.externalContext.requestContextPath}/css/work.css"
	rel="stylesheet" type="text/css" media="screen" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<script type="text/javascript">
//<![CDATA[ 
	function getScoreAll(){
		var lis_score = document.getElementsByName("scoreValue_id");
		var lis_tr = document.getElementsByName("tr_id");
		var lis_eq_id = document.getElementsByName("tp_eq_id");
		var strScoreValue="";
		for(var i=0;i<lis_score.length;i++)
		{
			var scoreValue = lis_score[i].value;
			strScoreValue+=scoreValue+"_";
				
		}
		for(var i=0;i<lis_eq_id.length;i++)
		{
			var eqValue = lis_eq_id[i].value;
			strScoreValue+=eqValue+"/";
			
		}
		//alert(strScoreValue);
		document.getElementById("j_id2:strScoreValue_id").value = strScoreValue;
	}
	function checkPonit(obj){
		var score = obj.value;
		var ponit = obj.id;
		if(parseInt(score)>parseInt(ponit)){
			alert("您给的得分超过了本题的分值，请从新批分！");
			obj.select();
		}
	}
	//]]> 
</script>

</head>
<body style="background-color: #ffffff">
<a4j:form>
	<div id="right">
	<div id="msgid" class="error pt10p bcf c0 tal" style="display: ">
	<a4j:outputPanel id="msgPanel">
		<center><h:outputText styleClass="cff"
			value="#{QualifyforBB.msg}" /></center>
	</a4j:outputPanel></div>
	<div class="tablelist">
		<table align="center" width="90%" border="0" cellpadding="0" cellspacing="0"
			bordercolor="#c3c3c3" style="border-collapse: collapse">
			<tr>
				<td>
				<h:inputHidden value="#{QualifyforBB.testee.tp_testee_id}" />
				<b>考核方案：<h:outputLabel style="border:none" class="style_input" value="#{QualifyforBB.examinebank.tp_e_aim}" /></b></td>
				<td><b>考核时间(m)：<h:outputLabel style="border:none" class="style_input" value="#{QualifyforBB.examinebank.tp_t_time}" /></b></td>
				<td><b>答题时间(s)：<h:outputLabel style="border:none" class="style_input" value="#{QualifyforBB.quest_time}" /></b></td>
				<td><b>考核分数：<h:outputLabel style="border:none" class="style_input" value="#{QualifyforBB.scoreSum}" /></b></td>
				<td><b>得分：<h:outputLabel style="border:none" class="style_input" value="#{(QualifyforBB.scoreAll==0)?'':QualifyforBB.scoreAll}" /></b></td>
			</tr>
		</table>
	</div>
	<ui:repeat var="testpaper" value="#{QualifyforBB.testpapers}">
			 <div>
				<table width="90%" border="1" cellpadding="0" cellspacing="0"
		bordercolor="#c3c3c3" style="border-collapse: collapse">
					<tr id="tr_id" style="">
						<td align="left" valign="center" style="color:#{(testpaper.tp_ea_answer==testpaper.tp_answer_code)?'block':'red'};background:#ccc;display:#{(testpaper.tp_question_type==1||testpaper.tp_question_type==2||testpaper.tp_question_type==3)? 'block':'none'}">
							第#{testpaper.tp_count}题:#{testpaper.tp_question_type_value}、
							<h:outputText escape="false" value="#{testpaper.tp_question}"/> 
							（#{testpaper.tp_ea_answer}） 正确答案（#{testpaper.tp_answer_code}）分值（#{testpaper.tp_point}）
						</td>
						<td align="left" valign="center" style="background:#ccc;display:#{(testpaper.tp_question_type==4||testpaper.tp_question_type==5)? 'block':'none'}">
							第#{testpaper.tp_count}题:#{testpaper.tp_question_type_value}、
							<h:outputText escape="false" value="#{testpaper.tp_question}"/> 分值（#{testpaper.tp_point}） 
						</td>
						<td width="10%">
							得分 <input id="#{testpaper.tp_point}" type="text" align="right" name="scoreValue_id" 
							style='BORDER-RIGHT:   #000000   0px   solid;   BORDER-TOP:   #000000   0px   solid;   BORDER-LEFT:   #000000   0px   solid;   BORDER-BOTTOM:   #000000   1px   solid;text-align:   center;background-color:#ccc' 
							size='4' value="#{testpaper.tp_ea_score}" onblur="checkPonit(this)" onkeyup="value=value.replace(/[^\Z0-9]/g,'')"/>
						</td>
					</tr>
					<tr id="tr_id">
						<td align="left" valign="center" style="background:#ccc">
						答案描述：	#{testpaper.tp_answer}
						</td>
					</tr>
					
					
					
					<tr>	
						<td align="left"><br/>
							<h:outputText escape="false" value="#{testpaper.tp_answerDiscription}"></h:outputText>
							<input name="tp_eq_id" type="hidden" value="#{testpaper.tp_eq_id}"/>
							<br/>
						</td>
					</tr>
				</table>
			</div>
	</ui:repeat>
	<div class="listbut">
		<h:inputHidden id="strScoreValue_id" value="#{QualifyforBB.strScoreValue}" />
		<h:commandButton 
		styleClass="buttonbg2" value="保存"
		action="#{QualifyforBB.updateScoreAll}" onclick="getScoreAll();" reRender="msgPanel" />
		<h:commandButton
		styleClass="buttonbg2" value="返回"
		action="#{QualifyforBB.toScoreBack}" reRender="msgPanel" />
		</div>
		<div  style="display:#{(QualifyforBB.msgShow==1)? 'block':'none'}">
			<h:outputText style="color:red" escape="false" value="#{QualifyforBB.msgValue}"></h:outputText>
		</div>
	</div>
</a4j:form>
</body>
</html>